<template>
	<view :class="['vh100',{'dark':theme == 'dark'}]">
		<view class="pt30 ">
			<SortPickerList ref="sortPickerList" @clickData="clickData" ></SortPickerList>
		</view>
	</view>
</template>


<script>
	import SortPickerList from "@/components/International-sortPickerList/index.vue";
	import {mapState,mapActions,mapGetters} from 'vuex';
	import {myMixins} from '@/common/myMixins.js'
	export default{
		mixins:[myMixins],
		data() {
			return {
				invite_code:'',
				user_string:'',
				area_code:'',
				code:'',
				nationality:'',
				returnUrl:"1001"
				
			}
		},
		computed:{
			...mapState({
			  theme:state=>state.theme
			}),
		},
		
	    components:{
	        SortPickerList
	    },
		onReady() {
		    var that = this
		    that.$refs["sortPickerList"].initPage();
		},
		onLoad(option) {
			this.$utils.setTheme(this.theme);
			uni.setNavigationBarTitle({
				title:this.$t('layer.emptyArea')
			})
			this.invite_code=option.invitecode
			this.user_string = option.userString
			this.code=option.code2
			this.returnUrl=option.returnUrl
			this.nationality = option.nationality
			this.area_code=option.areaCode
			console.log(option)
		},
		
		methods: {
		    clickData(data) {
		        console.log(data);
				this.area_code = data.value
				this.nationality=data.en
				//手机邀请码验证码，区号 类型
				if(this.returnUrl=="1001"){
					uni.navigateTo({
						url: '/register?invitecode='+this.invite_code+'&userString='+this.user_string+'&code2='+this.code+'&areaCode='+this.area_code+"&nationality="+this.nationality
					})
				}
				if(this.returnUrl=="1002"){
					uni.navigateTo({
						url: '/pages/forgetPwd/forgetPwd?userString='+this.user_string+'&areaCode='+this.area_code+"&nationality="+this.nationality
					})
				}
				
		    }
		}
	}
</script>

<style>

</style>
